<?php

namespace App\Models\goods;

use App\Models\base\traits\ImgTrait;
use App\Models\goods\observe\GoodsDetailObserve;
use App\Models\templates\Delivery;
use App\Models\user\observe\UserObserve;
use Illuminate\Database\Eloquent\Model;




/**
 * App\Models\goods\GoodsDetail
 *
 * @property int $id
 * @property string|null $icons 详细介绍图
 * @property int|null $goods_id 关联商品ID
 * @property string|null $type_name 类型名称
 * @property string|null $type_detail 类型详情
 * @property string|null $imgs 详情图
 * @property string|null $brief 商品简介
 * @property string|null $spec_name 规格名称
 * @property string|null $parameter 产品参数图
 * @property float $shop_price 小店用户价
 * @property int $shop_num 享受小店用户价需购买数量
 * @property float $business_price 企业用户价
 * @property int $business_num 享受企业用户价需购买数量
 * @property float $pt_price 拼团价
 * @property int $pt_num 拼团需参与人数
 * @property float $xql_price 秒杀星期六价格
 * @property float $sr_price 生日大礼包价格
 * @property int $is_zj 当前商品是否为正价  为正价返佣为正价返佣  否则返佣为活动价
 * @property float $zj_rebate_ratio1 正价导购返佣比例  最大为1
 * @property float $zj_rebate_ratio2 正价业务员返佣比例  最大为1
 * @property float $hd_rebate_ratio1 活动价导购返佣比例  最大为1
 * @property float $hd_rebate_ratio2 活动价业务员返佣比例  最大为1
 * @property int $delivery_id 运费模板ID
 * @property float $weight 商品重量
 * @property string $tags 商品标签
 * @property-read \App\Models\templates\Delivery $delivery
 * @property-read mixed $header_img
 * @property-read mixed $icon
 * @property mixed $img
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereBrief($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereBusinessNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereBusinessPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereDeliveryId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereGoodsId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereHdRebateRatio1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereHdRebateRatio2($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereIcons($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereImgs($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereIsZj($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereParameter($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail wherePtNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail wherePtPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereShopNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereShopPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereSpecName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereSrPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereTags($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereTypeDetail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereTypeName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereWeight($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereXqlPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereZjRebateRatio1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\goods\GoodsDetail whereZjRebateRatio2($value)
 * @mixin \Eloquent
 */
class GoodsDetail extends Model
{

    public $timestamps= false;

    use ImgTrait;

    protected $fillable = [
        'goods_id',
        'type_name',
        'type_detail',
        'imgs',
        'spec_name',
        'icons',
        'tags',
        'alias',
        'shop_price',
        'shop_num',
        'brief',
        'parameter',
        'business_price',
        'business_num',
        'pt_price',
        'pt_num',
        'xql_price',
        'sr_price',
        'is_zj',
        'zj_rebate_ratio1',
        'zj_rebate_ratio2',
        'hd_rebate_ratio1',
        'hd_rebate_ratio2',
        'delivery_id',
        'weight',
    ];

    public static function boot()
    {
        parent::boot();
        static::observe(new GoodsDetailObserve());

    }

    public function delivery()
    {
        return $this->BelongsTo(Delivery::class);
    }



}
